home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Mathematics / TeX / TeXsis-2.15 / Tablebody.txs < prev    next >
Encoding:
Text File  |  1992-08-04  |  4.9 KB  |  92 lines

  1. %: Tablebody.txs                                   TeXsis version 2.15  
  2. %  $Revision: 15.1 $  :  $Date: 91/11/20 18:56:00 $  :  $Author: myers $
  3. %======================================================================*
  4. % Old-style Figure macros               -  This file is a part of TeXsis
  5. %                       (C) copyright 1991 by Eric Myers and Frank Paige.
  6. %
  7. % SIMPLE(R) RULED TABLES:  \Tablebody
  8. %
  9. %       The following macros make simple ruled tables with automatic spacing,
  10. % i.e. no vertical struts are needed. Taken from TechRpt with modifications as
  11. % in TeXsis 2.11.  These are included for backward compatability
  12. % and will eventually be phased out.
  13.      
  14. %       \Tablebody actually begins the table body, with the \halign template.
  15. % #1 is number of columns. \Tableskipsize is set by \singlespaced,
  16. % \doublespaced, etc. in TXSmacs.
  17. %======================================================================*
  18. \catcode`@=11                                   % make @ a letter for this file
  19.      
  20. \def\Tablebody#1{%                                      % #1 = no. columns
  21.    \hbox to \hsize\bgroup                               % start hbox for table
  22.    \hss $$ \vbox\bgroup                                 % centered displaymath
  23.    \offinterlineskip                                    % No interline glue
  24.    \def\tablerule{\noalign{\hrule}}                     % simple rule
  25.    \def\T@bleskip{\Tableskip{#1}{\Tableskipsize}}       % nice skip
  26.    \def\T@blerule{\T@bleskip\tablerule\T@bleskip}       % nice rule
  27.    \def\Cr{\cr\T@bleskip}                               % \cr and nice skip
  28.    \def\CR{\cr\T@blerule}                               % \cr and nice rule
  29.    \def\CRCR{\cr\T@bleskip\tablerule                    % \cr and nice double
  30.       \Tableskip{#1}{1pt}\tablerule\T@bleskip}          % rule
  31.    \def~{\phantom{0}}                                   % ~ is digit-width space
  32.      \halign\bgroup                                     % start \halign
  33.       \vrule##                                          % do leftmost vrule
  34.       &&\quad\hfil##\hfil\quad\strut                    % repeat for each column
  35.       &\vrule##\crcr                                    % vrule on the right
  36.    \tablerule                                           % hrule at top of table
  37.    \T@bleskip}                                          % add some space
  38.  
  39. \def\tablebody{\Tablebody}                              % synonym
  40.      
  41. %       \endTablebody closes \Tablebody.
  42.      
  43. \def\endTablebody{                                      %
  44.    \bottomrule                                          % put rule at bottom
  45.    \crcr\egroup                                         % close the \halign
  46.    \egroup $$                                           % close vbox, math
  47.    \hss\egroup}                                         % close the hbox
  48.      
  49. \def\endtablebody{\endTablebody}                        % synonym
  50.  
  51. %       \Tablebodyleft is just like \Tablebody except that the columns are
  52. % set flush left.
  53.      
  54. \def\Tablebodyleft#1{%                                  % #1 = no. columns
  55.    \hbox to \hsize\bgroup                               % start hbox for table
  56.    \hss $$ \vbox\bgroup                                 % centered displaymath
  57.    \offinterlineskip                                    % No interline glue
  58.    \def\tablerule{\noalign{\hrule}}                     % simple rule
  59.    \def\T@bleskip{\Tableskip{#1}{\Tableskipsize}}       % nice skip
  60.    \def\T@blerule{\T@bleskip\tablerule\T@bleskip}       % nice rule
  61.    \def\Cr{\cr\T@bleskip}                               % \cr and nice skip
  62.    \def\CR{\cr\T@blerule}                               % \cr and nice rule
  63.    \def\CRCR{\cr\T@bleskip\tablerule                    % \cr and nice double
  64.       \Tableskip{#1}{1pt}\tablerule\T@bleskip}          % rule
  65.    \def~{\phantom{0}}                                   % ~ is digit-width space
  66.      \halign\bgroup                                     % start \halign
  67.       \vrule##                                          % do leftmost vrule
  68.       &&\quad##\hfil\quad\strut                         % repeat for each column
  69.       &\vrule##\crcr                                    % vrule on the right
  70.    \tablerule                                           % hrule at top of table
  71.    \T@bleskip}                                          % add some space
  72.      
  73. %       \Tableskip#1#2 produces a vertical skip with rules of height #2 for
  74. % a table with #1 columns.
  75. %       \tablerule produces just a rule.
  76. %       \Tablerule#1#2 produces a rule with a skip of dimen #2 on each side
  77. % for a table with #1 columns.
  78.      
  79. \def\Tableskip#1#2{height #2 \global\mscount#1%
  80.         \gloop\ifnum\mscount>\z@ \Tsk@p\repeat\cr}
  81. \def\Tsk@p{&\omit&\global\advance\mscount\m@ne}
  82.      
  83. \def\Tablerule#1#2{\Tableskip#1#2\tablerule\Tableskip#1#2}
  84.      
  85. %       \bottomrule is a horizontal rule across the table. It is turned off
  86. % by \nobottomrule (locally to the \halign)
  87.      
  88. \def\bottomrule{\tablerule}
  89. \def\nobottomrule{\let\bottomrule=\relax}
  90.      
  91. %>>> EOF Tablebody.txs <<<
  92.